<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">


<head th:replace="fragments/common_header :: common-header(~{},~{})"></head>
<body>
<div id="wrapper">
    <!-- 左侧菜单栏-->
    <div th:replace="fragments/common_leftmenu :: left-menu"></div>
    <!-- 左侧菜单栏结束-->
    <div id="page-wrapper" class="gray-bg">
        <!-- 上部导航条 -->
        <div th:replace="fragments/common_top :: top-bar"></div>
        <!-- 上部导航条结束 -->
        <!--内容-->
        <div class="wrapper wrapper-content animated ">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox ">
                        <div class="ibox-title">
                            <h2 th:text="'当前编辑的汽车编号：'+${car.getCar_number()}"></h2>
                        </div>
                        <div class="ibox-content">
                            <form th:method="post" th:action="@{/car/update}">
                                <h3>编辑汽车属性</h3>
                                <div class="form-group row">
                                    <div class="col-sm-2">
                                        <label class="col-form-label">汽车名称：</label>
                                        <input type="text" class="form-control" name="car_name" required="" maxlength="20"
                                               th:value="${car.getCar_name()}" placeholder="汽车名称">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">所属门店：</label>
                                        <input type="text" class="form-control" name="shop_name" required="" maxlength="20"
                                               th:value="${car.getShop_name()}" placeholder="所属门店">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">汽车品牌：</label>
                                        <input type="text" class="form-control" name="car_brand"  maxlength="20"
                                               th:value="${car.getCar_brand()}" placeholder="汽车品牌">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">汽车类型：</label>
                                        <input type="text" class="form-control" name="car_type"  maxlength="20"
                                               th:value="${car.getCar_type()}" placeholder="汽车类型">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">日租金：</label>
                                        <input type="text" class="form-control" name="daily_rent" required="" maxlength="20"
                                               th:value="${car.getDaily_rent()}" placeholder="日租金">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">押金：</label>
                                        <input type="text" class="form-control" name="car_deposit" required="" maxlength="20"
                                               th:value="${car.getCar_deposit()}" placeholder="押金">
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">汽车状态：</label>
                                        <select class="form-control" name="car_state">
                                            <option value="">请选择</option>
                                            <option value="已租" th:selected="${car.getCar_state() eq '已租'}">已租</option>
                                            <option value="未租" th:selected="${car.getCar_state() eq '未租'}">未租</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-2">
                                        <label class="col-form-label">服务费：</label>
                                        <input type="text" class="form-control" name="car_fuwu" required="" maxlength="20"
                                               th:value="${car.getCar_fuwu()}" placeholder="服务费">
                                    </div>
                                </div>

                                <!--隐藏区域开始-->
                                <input type="hidden" class="form-control" name="car_number" th:value="${car.getCar_number()}"/>
                                <input type="hidden" class="form-control" name="car_picture" th:value="${car.getCar_picture()}"/>
                                <!--隐藏区域结束-->
                                <div class="form-group">
                                    <div class="text-center">
                                        <button class="btn btn-white btn-lg"
                                                th:action="'@{/car/toList'+${car.getShop_name()}"
                                                >取消</button>
                                        <button class="btn btn-primary btn-lg" type="submit">保存</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--内容结束-->
        <!-- 底部栏 -->
        <div th:replace="fragments/common_footer :: foot-bar"></div>
        <!-- 底部栏结束 -->
    </div>
</div>
<div th:replace="fragments/common_script :: scripts"></div>

<script>
    // 取消按钮
    function doCancel()
    {
        window.location.href = document.referrer;
    }
</script>
</body>
</html>